home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / text / faqs / linux.howto.ethernet < prev    next >
Encoding:
Internet Message Format  |  1993-10-10  |  39.5 KB

  1. Subject: Linux Ethernet HOWTO
  2. Newsgroups: comp.os.linux.announce,comp.os.linux.admin,comp.answers,news.answers
  3. From: Paul Gortmaker <paul@cain.mmtc.rmit.oz.au>
  4. Date: 8 Oct 1993 21:05:54 GMT
  5.  
  6. Archive-Name: linux/howto/ethernet
  7. Last-Modified: August 28, 1993
  8.  
  9. Linux Ethernet HOWTO v0.1 -- Last updated August 28, 1993
  10. ---------------------------------------------------------------------------
  11. 0. Introduction
  12.  
  13.     This is the Ethernet-HOWTO, which is a compilation of information
  14.     about which ethernet devices can be used for Linux, and how to
  15.     set them up.
  16.  
  17.     This Ethernet-HOWTO is by Donald J. Becker and Paul Gortmaker.
  18.     It covers what cards you should and shouldn't buy; how to set
  19.     them up, how to run more than one, and other common problems and
  20.     questions. It does *not* cover the software end of things, as that
  21.     is covered in the NET-2 HOWTO. You can freely distribute this 
  22.     document as long as you distribute an original copy with the 
  23.     author's names intact.
  24.  
  25.     Most of this information came from Donald J. Becker 
  26.     <becker@super.org> who is responsible for writing and 
  27.     supporting most of the ethernet drivers that are presently
  28.     available. Bj0rn Ekwall <bj0rn@blox.se> is responsible for
  29.     the D-Link pocket driver. A special thanks to others who have helped
  30.     with the device drivers and testing.
  31.  
  32. 0.1 Disclaimer
  33.  
  34.     This document is *not* gospel. However, it is probably the most
  35.     up to date info that you will be able to find. Nobody is responsible
  36.     for what happens to your hardware but yourself. If your ethercard
  37.     goes up in smoke (...nearly impossible!) we take no responsibility.
  38.  
  39. 0.2 Questions already?
  40.  
  41.         If you have questions about your ethernet card, please READ this
  42.     document first. You may also want to join the NET channel of the
  43.     Linux-activists mailing list by sending mail to
  44.                 linux-activists-request@niksula.hut.fi
  45.         with the line
  46.                 X-Mn-Admin: join NET
  47.         at the top of the message body (not the subject). Note that the NET
  48.     channel is primarily used for discussion of the networking code, and
  49.     you may not see much discussion about a particular driver.
  50.         Furthermore keep in mind that the NET channel is for development
  51.     discussions only. General questions on how to configure your system
  52.     should be directed to comp.os.linux.help unless you are actively
  53.     involved in the development of part of the networking for Linux.
  54.  
  55. 0.3 Related Documentation
  56.  
  57.     Much of this info came from small files and saved postings by Donald
  58.     himself. These can be found in /pub/linux/info on ftp.super.org
  59.     [192.31.192.1] Of course, if you are setting up an Ethernet card,
  60.     then you will want to read the NET-2 HOWTO so that you can actually
  61.     do something with it.
  62.  
  63. 0.4 New versions of this document
  64.  
  65.         New versions of this document can be retrieved via anonymous
  66.         FTP from sunsite.unc.edu:/pub/Linux/docs/HOWTO/*.  It will also be
  67.     posted to the newsgroup comp.os.linux.announce.
  68.  
  69. 0.5 Feedback
  70.  
  71.     Any corrections can be sent to one of us (paul@cain.mmtc.rmit.oz.au
  72.     or becker@super.org) We will *attempt* to keep this up to date as
  73.     more drivers become available, and as NET-2 matures.
  74.  
  75. 1. Supported Ethernet Cards for Linux
  76.  
  77.     The only thing that one needs to use an ethernet card with Linux 
  78.     is the appropriate driver. For this, it is essential that the man-
  79.     ufacturer will release the technical programming information to
  80.     the general public without you (or anyone) having to sign your life
  81.     away. A good guide for the likelihood of getting documentation
  82.     (or, if you aren't writing code, the likelihood that someone
  83.     else will write that driver you really, really need)
  84.     is the availability of the Crynwr (nee Clarkson) packet
  85.     driver.  Given the documentation, you can write a driver for
  86.     your card and use it for Linux, at least in theory.
  87.  
  88.     Most cards come with drivers for MS-DOS interfaces such as
  89.     NDIS and ODI, but these are useless for Linux.  Many people
  90.     have suggested directly linking them in or automatic
  91.     translation, but this is nearly impossible.  The MS-DOS
  92.     drivers expect to be in 16 bit mode and hook into "software
  93.     interrupts", both incompatible with the Linux kernel.  This
  94.     incompatibility is actually a feature, as some Linux drivers
  95.     are considerably better than their MS-DOS counterparts.  The
  96.     "8390" series drivers, for instance, use ping-pong transmit
  97.     buffers, which are only now being introduced in the MS-DOS world.
  98.  
  99.     Keep in mind that PC ethercards have the widest variety of
  100.     interfaces (shared memory, programmed I/O, bus-master, or slave
  101.     DMA) of any computer hardware for anything, and supporting a
  102.     new ethercard sometimes requires re-thinking most of the
  103.     lower-level networking code.  Also, similar product numbers
  104.     don't always indicate similar products.  For instance, the
  105.     3c50* product line is wildly different between members.
  106.  
  107.     Here is what drivers are and aren't available.
  108.  
  109. 1.1 3com Ethernet cards
  110.  
  111.     Supported:
  112.         3c503, 3c503/16 --
  113.             3Com shared-memory ethercards.  They also have a
  114.                 programmed I/O mode that doesn't use the 8390 
  115.             facilities (their engineers found too many bugs!)  
  116.             It should be about the same speed as the same bus 
  117.             width WD80x3, but I don't have a 16 bit version 
  118.             to benchmark. Unless you are a light user, spend
  119.             the extra money and get the 16 bit model, as the
  120.             savings aren't huge. The 3c503 does not have "EEPROM
  121.             setup", so the diagnostic/setup program isn't needed 
  122.             before running the card with Linux. The shared memory 
  123.             address of the 3c503 is set using jumpers that
  124.                 are shared with the boot PROM address.  This is
  125.             confusing to people familiar with other ISA cards, 
  126.             where you always leave the jumper set to "disable" 
  127.             unless you have a boot PROM. The Linux 3c503 driver 
  128.             will work with the 3c503 programmed-I/O mode, but this 
  129.                 is slower and less reliable than shared memory mode.
  130.  
  131.             Also, programmed-I/O mode is not tested when updating
  132.             the drivers, and the deadman (deadcard?) check code 
  133.             may be falsely triggered on some machines.
  134.             The IRQ line is set in software, with no hints
  135.             from e.g. EEPROM.  Unlike the MS-DOS driver, the 
  136.             Linux driver has capability to autoIRQ: it uses the 
  137.             first available IRQ line in {5,2,3,4}, selected each 
  138.             time the card is 'ifconfig'ed.  (Older driver versions 
  139.             selected the IRQ at boot time.)  The ioctl() call 
  140.             in 'ifconfig' will return EAGAIN if no IRQ line is 
  141.             available at that time. 
  142.  
  143.         3c509 --
  144.             A new card for 3Com. It should be cheap and have
  145.             excellent performance. The drawbacks are that it
  146.             _requires_ very low interrupt latency, and it isn't
  147.             rated for bus speeds greater than 8Mhz. The driver is 
  148.             written, working, and included in pl12. But it
  149.             seems to triggers a Linux TCP bug, so it's not built
  150.             as part of the default kernel.
  151.  
  152.             There is also an alpha version of a Linux 3c509
  153.             diagnostic and EEPROM setup program, but for now
  154.             users that don't like the defaults should use the
  155.             MS-DOS EEPROM setup program.
  156.  
  157.         3c579 --
  158.             The EISA version of the 509. The current EISA version
  159.             uses the same 16 bit wide chip rather than a 32 bit
  160.             interface, so the performance increase isn't stunning.
  161.             The 3c509 driver should work with the EISA
  162.             version, but I have neither an EISA machine nor
  163.             a 3c579 to test it on.
  164.  
  165.     Unsupported:
  166.  
  167.         3c501 --
  168.             Too brain-damaged to use. Available surplus from many
  169.             places. Avoid it like the plague. However, if you are
  170.             a bit of a masochist, there is some code in /pub/linux
  171.             on ftp.super.org --> look for 3c501.c Again, do not
  172.             purchase this card, even as a joke.  It's performance
  173.             is horrible, and it breaks in many ways.  
  174.  
  175.             For those not yet convinced, the 3c501 can only do one
  176.             thing at a time -- while you are removing one packet
  177.             from the single-packet buffer it cannot receive
  178.             another packet, nor can it receive a packet while are
  179.             loading a transmit packet.  This was fine for a
  180.             network between two 8088-based computers where
  181.             processing each packet and replying took 10's of
  182.             msecs, but modern networks send back-to-back
  183.             packets for almost every transaction.
  184.  
  185.         3c505 --
  186.             Not available at present.
  187.  
  188.         3c507 --
  189.             Not available at present.
  190.  
  191. 1.2 Western Digital / SMC Cards
  192.  
  193.     The ethernet part of Western Digital has been bought by SMC.  The
  194.     SMC Elite and SMC Elite Plus are the same as late-model WD8003 
  195.     and WD8013 cards.
  196.  
  197.     Supported:
  198.  
  199.         WD8003, WD8013, SMC Elite, SMC Elite Plus --
  200.             A shared memory design by Western Digital. The
  201.             8 bit 8003 is slightly less expensive, but only
  202.             worth the savings for light use. Over the
  203.             years the design has added more registers and an
  204.             EEPROM.  Clones usually go by the '8013' name, and 
  205.             usually use a non-EEPROM (jumpered) design. This part
  206.             of WD has been sold to SMC, so you'll usually see 
  207.             something link SMC/WD8013 or SMC Elite Plus (WD8013).  
  208.             The shared memory makes the cards 10-20% faster,
  209.             especially with larger packets. More importantly
  210.             (to me at least) it avoids a few bugs in the
  211.             programmed-I/O mode of the 8390, allows safe
  212.             multi-threaded access to the packet buffer, and 
  213.             doesn't have a programmed-I/O data register that 
  214.             hangs your machine during warm-boot probes.  
  215.  
  216. 1.3 NExxxx Cards
  217.  
  218.     The prefix "NE" came from Novell Ethernet.  Novell followed the 
  219.     cheapest NatSemi databook design and sold the manufacturing rights 
  220.     (spun off?) Eagle, just to get reasonably-priced ethercards into 
  221.     the market.
  222.  
  223.     Supported:
  224.  
  225.         NE1000, NE2000 --
  226.             The now-generic name for a bare-bones design around 
  227.             the NatSemi 8390. They use programmed I/O rather than
  228.             shared memory, leading to easier installation but 
  229.             slightly lower performance and a few problems. Again,
  230.             the savings of using an 8 bit NE1000 over the NE2000
  231.             are only warranted if you expect light use. Some 
  232.             recently introduced NE2000 clones use the National
  233.             Semiconductor "AT/LANTic" 83905 chip, which offers 
  234.             a shared memory mode similar to the 8013 and EEPROM
  235.             or software configuration. Some problems can arise
  236.             with poor clones. See the question and answer section
  237.             later in this document, and the section on clones.
  238.  
  239.         NE1500, NE2100 --
  240.             The AT1500 driver, recently added to the list of
  241.             supported cards, also supports the NE1500, NE2100 and
  242.             clones. The driver shipped with pl12 kernel doesn't 
  243.             detect non-AT1500 cards with autoprobe, but will work 
  244.             fine if you specify the base address explicitly and 
  245.             jumper for DMA channel 5.
  246.  
  247. 1.3 Hewlett Packard Cards
  248.  
  249.     HP-LAN ethercards: Nicely made, but hard to find.  The model
  250.     numbers don't encode anything, so you'll have to go by the 
  251.     description. 
  252.  
  253.     Supported:
  254.  
  255.          272[45]* series, 27245, 27247, 27250 --
  256.             They use programmed I/O, similar to the NE*000 boards,
  257.             but the data transfer port can be "turned off" when 
  258.             you aren't accessing it, avoiding problem with 
  259.             autoprobing drivers. Note that few people seem to use 
  260.             them, and I've had conflicting reports about changes 
  261.             between versions with the same model number -- later
  262.             versions may not work.
  263.  
  264. 1.4 D-Link 
  265.  
  266.     There is a file /usr/src/linux/net/inet/README.DLINK that you
  267.     should read if you are going to use D-Link stuff. Note, however 
  268.     that the installation info in this file is no longer valid, as it
  269.     applied to pre NET-2 kernels. It is now a part of the standard kernel.
  270.     
  271.     Supported:
  272.  
  273.         DE-600 --
  274.             Laptop users and other folk who might want a quick 
  275.             way to put their computer onto the ethernet may want 
  276.             to use this. The driver is included with the default 
  277.             kernel source tree as of pl12 and possibly earlier. 
  278.             Bjorn Ekwall <bj0rn@blox.se> wrote the original. 
  279.             Expect about 80kb/s transfer speed from this via the 
  280.             parallel port. The file mentioned above contains 
  281.             a "Known Problems and..." section. I will not repeat 
  282.             it here. But you should read it.  (Hint applied gently 
  283.             with a sledgehammer.)
  284.  
  285.         DE100, DE200, DE-220-T --
  286.             The manual says that it is 100% compatible with the
  287.             NE2000.  This is not true. You should call them and tell
  288.             them you are using their card with Linux, and that they
  289.             should correct their documentation.  Some pre-0.99pl12 
  290.             driver versions may have trouble recognizing the DE2** 
  291.             series as 16 bit cards, and these cards are the most 
  292.             widely reported as having the spurious transfer address
  293.             mismatch errors.
  294.  
  295. 1.5 Cabletron
  296.  
  297.     Yes, another one of these companies that won't release its
  298.     programming information. They waited for months before actually
  299.     confirming that all their information was proprietary. If you feel
  300.     like asking them why they don't want to release their info so that
  301.     people can use their cards, write to pkelly@ctron.com. You should
  302.     read section 8.1 of this document, as it has specific information
  303.     pertaining to Cabletron.
  304.  
  305.     Supported:
  306.  
  307.         E10**, E10**-x, E20**, E20**-x --
  308.             These are NEx000 almost-clones that are reported to work
  309.             with the standard NEx000 drivers, thanks to a 
  310.             ctron-specific check during the probe. If there are 
  311.             any problems, they are unlikely to be fixed, as the 
  312.             programming information is unavailable.
  313.  
  314.     Unsupported:
  315.  
  316.         E21** --
  317.             Again, there is not much one can do when the
  318.             programming information is proprietary. Feel free
  319.             to ask pkelly@ctron.com.  This is the only 8390-base
  320.             ethercard series that isn't supported by Linux.
  321.  
  322. 1.6    Allied Telesis:
  323.  
  324.     Allied Telesis is the worlds largest maker of separate
  325.     transceivers thanks to their low prices, and they now have a
  326.     series of low-cost ethercards using the 79C960 version of the AMD
  327.     LANCE.  These are bus-master cards, and thus probably the fastest
  328.     ISA bus ethercards available (although the 3c509 has lower latency
  329.     thanks to predictive interrupts).  The driver for the AT1500
  330.     series is new in the 0.99pl12 kernel, but it won't work
  331.     "out-of-the-box" with >16M machines.  (NB This isn't a fundamental
  332.     limitation, so stop pointing and laughing at the ISA bus.  The
  333.     driver just needs a hook to allocate low-memory buffers for the
  334.     bus-master DMA, and should be just as fast on >16M systems.)
  335.  
  336.     The current (pl12) driver defaults to DMA5.  Future driver
  337.     versions may figure out a way to autoDMA.
  338.  
  339.     There is a special $20 one-unit-only evaluation offer on the AT1500T
  340.     (the TP-only model) until mid-September 1993.  The normal list
  341.     price is $80-$100.
  342.     
  343.  
  344. 1.6 Other (less common card supplier) Companies
  345.  
  346.     Arcnet:
  347.         There is no Arcnet driver for Linux. Feel free to write a 
  348.         driver.  There might be people with home systems
  349.         that will be able to use it with discarded hardware. 
  350.         With the very low cost and better performance of ethernet,
  351.         I expect that most places will be giving away their Arcnet
  352.         hardware for free.
  353.  
  354.         An advantage of Arcnet is that all of the cards have identical
  355.         interfaces, so once a driver is available it will work for everyone.
  356.  
  357.     Digital / DEC
  358.         There is an alpha version of a driver for the early model DEC
  359.         DEPCA.  DEC is refusing to release information on the later
  360.         models.  (The rumor is that they don't have enough money to
  361.         write and print one!)
  362.  
  363.     Intel:
  364.         Not too many of these cards around at present. The Intel Ether-
  365.         Express is unsupported at present.
  366.  
  367.     PureData:
  368.         The PureData PDUC8028 and PDI8023 series of cards are reported
  369.         to work, thanks to special probe code contributed by Mike
  370.         Jagdis <jaggy@purplet.demon.co.uk>.  The support is integrated
  371.         with the WD driver.
  372.  
  373.     Xircom:
  374.         Another group that won't release documentation. No cards 
  375.         supported.  Don't look for any support in the future unless 
  376.         they release their programming information. And this is
  377.         highly unlikely, as they *forbid* you from even reverse-
  378.         engineering their drivers. Here is some of the results from
  379.         people who have tried to deal with Xircom.
  380.  
  381.         "I had no end of problems trying to work with Xircom.  
  382.         After spending months talking to them and working up a
  383.         prospectus, I was told that no information would be forthcoming
  384.         and that they were not interested in markets other than the
  385.         ISA/DOS market. (I was trying to interface the pocket adapters
  386.         to an Amiga). I won't work with them anymore and I won't
  387.         recommend their products to anyone." 
  388.  
  389.         "They (Xircom) won't give it (programming info.) out. BSDI
  390.         was was able to get the spec and write a driver for it, but
  391.         only by promising not to give out the source."
  392.  
  393.     Zenith:
  394.         The Zenith Z-note is unsupported at present.
  395.  
  396. 2. Clones of popular Ethernet cards.
  397.  
  398.     Due to the popular design of some cards,  different companies will
  399.     make "clones" or replicas of the original card. However, one must
  400.     be careful, as some of these clones are not 100% compatible, and
  401.     can be troublesome. Some common problems with "not-quite-clones"
  402.     are noted in the question and answer section of this document.
  403.  
  404. 2.1 WD80x3 Clones that are reported to work.
  405.  
  406.     AT-LAN-TEC 8013
  407.     PureData (not a 8013 clone, but the 8013 driver has special code)
  408.     LANNET LEC-45
  409.     PE-8013 (WD-8013 Compatible)
  410.  
  411. 2.2 NE2000 Clones that are reported to work.
  412.  
  413.     Alta Combo NE2000 clone
  414.     Aritsoft LANtastic AE-2 (OK, but has flawed error-reporting registers)
  415.     Asante Etherpak 2001/2003
  416.     AT-LAN-TEC NE2000 clone (uses Winbond chip that traps SCSI drivers)
  417.     Cabletron products: E10**,  E10**-x,  E20**, E20**-x
  418.     Cnet UTP 10baseT (NE 2000 emulation)
  419.     D-Link Ethernet II (bad clones, but the driver checks for them)
  420.     4-Dimension FD0490 EtherBoard16
  421.     LTC E-NET/16 P/N: 8300-200-002 (lipka@lip.hanse.de)
  422.     Network Solutions HE-203
  423.     SIIG Inc E-Lan/200 (NE 2000 comp.)
  424.     SVEC 4 Dimension Ethernet
  425.  
  426. 3 The Card to buy is....
  427.  
  428.     For impatient users that just want a quick, cheap answer the 
  429.     summary is: get 16 bit thinnet 8013 cards. For more detail as
  430.     to the who what where and why, read on.
  431.  
  432. 3.1 Eight bit vs 16 bit.
  433.  
  434.     Unless you are a light user, or are confined to using the smaller
  435.     ISA slot, the use of the 8 bit cards like the wd8003 and the 3c503
  436.     is really not worth the cost savings. Get the 8013 or the 3c503/16
  437.     instead.
  438.  
  439. 3.2 Prices are a bit steep for the XXXX card.
  440.  
  441.     I keep track of the current low-price vendors, just because it's
  442.     asked so often.  Call AT-LAN-TEC at 301-948-7070.  Ask for their
  443.     technical support person, "Vincent Bono".  As with all purchases,
  444.     you should indicate you are buying this for a Linux system.
  445.     The last I checked the price for 10 NE2000s was $690, or $69 ea.!
  446.     NB Their current NE2000 clone is a model that "traps" other
  447.     drivers that probe into their address space.
  448.  
  449.     AT-LAN-TEC also carries a clone, non-EEPROM 8013 board for $89,
  450.     and a NE2100 clone.  Either is a better choice if the very lowest
  451.     price isn't essential. 
  452.  
  453.     I've also ordered Alta "Combo" NE2000 cards from Network Express
  454.     (aka Main Street Computers) in Fl.  A bit more expensive, but
  455.     they have bigger ads in Computer Shopper. If you are looking for
  456.     prices on your own, try the back of LAN magazine.
  457.  
  458.     Currently (late Aug. '93) there is a market-share war going on in
  459.     the ethercard business.  Both Allied-Telesis and Accton have
  460.     special evaluation deals going on if you call them directly and
  461.     reference the right advertisement.  (AT1500T $20, max. one, and
  462.     Accton NE2000 clone $30+$5s&h, max. 2.)
  463.  
  464. 3.3 Type of cable that your card should support.
  465.  
  466.     Unless you have to conform to an existing network, you will want
  467.     to use thinnet or thin ethernet cable. This is the style with the
  468.     standard BNC connectors. See the next section on concerns with
  469.     different types of ethernet cable.
  470.  
  471.     Most ethercards also come in a "Combo" version for only $10-$20 more.
  472.     These have both twisted pair and thinnet transceiver built-in,
  473.     allowing you to change your mind later.
  474.  
  475. 4. Cables, Coax, Twisted pairs etc.
  476.    
  477.     If you are starting a network from scratch, it's considerably less
  478.     expensive to use thin ethernet, RG58 co-ax cable with BNC connectors,
  479.     than old-fashioned thick ethernet, RG-5 cable with N connectors, or
  480.     10baseT, twisted pair telco-style cables with RJ-45 "phone"
  481.     connectors.
  482.  
  483. 4.1 Thin Ethernet (thinnet).
  484.  
  485.     Thin ethernet is the "ether of choice".  The cable is inexpensive.  If
  486.     you are making your own cables solid-core RG58A is $0.09/ft. and
  487.     stranded RG58AU is $0.15/ft.  Twist-on BNC connectors are < $2 ea.,
  488.     and other misc. pieces are similarly inexpensive.  It is essential
  489.     that you properly terminate each end of the cable with 50 ohm
  490.     terminators, so budget $2 ea. for a pair.  It's also vital that
  491.     your cable have no "stubs" -- the 'T' connectors must be attached
  492.     directly to the ethercards.
  493.  
  494. 4.2 Twisted Pair.
  495.  
  496.     Twisted pair networks require active hubs, which start around $300,
  497.     and the raw cable cost can actually be higher than thinnet.  They are
  498.     usually sold using the claim that you can use your existing telephone
  499.     wiring, but it's a rare installation where that turns out to be the
  500.     case.  The claim that you can upgrade to higher speeds is also
  501.     suspect, as most proposed schemes use higher-grade (read $$) cable and
  502.     more sophisticated termination ($$$) than you would likely install on
  503.     speculation.
  504.  
  505. 4.3 Thick Ethernet.
  506.  
  507.     Thick ethernet is mostly obsolete, and is usually used only to remain
  508.     compatible with an existing implementation.  You can stretch the rules
  509.     and connect short spans of thick and thin ethernet together with a
  510.     passive $3 N-to-BNC connector, and that's often the best solution to
  511.     expanding an existing thicknet.  A correct (but expensive) solution is
  512.     to use a repeater in this case.
  513.  
  514. 5 Technical Information.
  515.  
  516.     For those who want to play with the present drivers, or try to make
  517.     up their own driver for a card that is presently unsupported, this
  518.     information should be useful. If you do not fall into this category,
  519.     then perhaps you will want to skip this section.
  520.  
  521. 5.1 Probed Addresses.
  522.  
  523.     While trying to determine what ethernet card is there, the following
  524.     addresses are autoprobed, assuming the type and specs of the card
  525.     have not been set in the kernel. In /usr/src/linux/net/inet/CONFIG,
  526.     one can set the cards that are compiled in to the kernel. As of 
  527.     0.99pl12, doing a "make config" will ask what cards are to be 
  528.     supported. The file names below are in /usr/src/linux/net/inet/
  529.     ----------------------------------------------------------------
  530.     wd.c:   0x300, 0x280, 0x380, 0x240
  531.     3c503:  0x300, 0x310, 0x330, 0x350, 0x250, 0x280, 0x2a0, 0x2e0
  532.     ne.c:   0x300, 0x280, 0x320, 0x340, 0x360
  533.     hp.c:   0x300, 0x320, 0x340, 0x280, 0x2C0, 0x200, 0x240
  534.     lance.c:0x300, 0x320, 0x340, 0x360
  535.     ----------------------------------------------------------------
  536.     There are some NE2000 clone ethercards out there that are waiting black
  537.     holes for autoprobe drivers.  While many NE2000 clones are
  538.     safe until they are enabled, some can't be reset to a safe mode.
  539.     These dangerous ethercards will hang any I/O access to their
  540.     "dataports".  The typical dangerous locations are:
  541.  
  542.     Ethercard jumpered base     Dangerous locations (base + 0x10 - 0x1f)
  543.         0x300 *                0x310-0x317
  544.         0x320                0x330-0x337
  545.         0x340                0x350-0x357
  546.         0x360                0x370-0x377
  547.  
  548.     * The 0x300 location is the traditional place to put an ethercard, but
  549.     it's also a popular place to put other devices (often SCSI
  550.     controllers).  The 0x320 location is often the next one chosen, but
  551.     that's bad for for the AHA1542 driver probe.  The 0x360 location is
  552.     bad, because it conflicts with the parallel port at 0x378.
  553.  
  554.     To avoid these lurking ethercard, here are the things you can do:
  555.  
  556.         o Probe for the device's BIOS in memory space.  This is easy
  557.       and always safe, but it only works for cards that always have
  558.       BIOSes, like primary SCSI controllers.
  559.  
  560.     o Avoid probing any of the above locations until you think
  561.       you've located your device.  The NE2000 clones have a reset range
  562.       from <base>+0x18 - <base>+0x1f that will read as 0xff, so probe
  563.       there first if possible.  It's also safe to probe in the 8390
  564.       space at <base>+0x00 - <base>+0x0f, but that area will return
  565.       quasi-random values
  566.  
  567.     o If you must probe in the dangerous range, for instance if your
  568.       target device has only a few port locations, first check that
  569.       there isn't an NE2000 there. You can see how to do this by 
  570.       looking at the probe code in /usr/src/linux/net/inet/ne.c
  571.  
  572. 5.2 Skeleton / Prototype Driver.
  573.  
  574.     OK. So you have decided that you want to write a driver for the
  575.     Foobar Ethernet card, as you have the programming information,
  576.     and it hasn't been done yet. (...these are the two main require-
  577.     ments ;-) You can use the skeleton network driver that is provided
  578.     with the Linux kernel source tree. It can be found in the file
  579.     /usr/src/linux/net/inet/README.DRIVERS as of 0.99pl12, and later.
  580.  
  581.     It's also very useful to look at the Crynwr (nee Clarkson) driver
  582.     for your target ethercard, if it's available.  Russ Nelson
  583.     <nelson@crynwr.com> wrote most of these, and he has been very
  584.     helpful with his code reviews of the current Linux drivers.
  585.  
  586. 5.3 Driver Interface to the Kernel
  587.  
  588.     Here are some notes that may help when trying to figure out what
  589.     the code in the driver segments is doing, or perhaps what it is
  590.     supposed to be doing.
  591.  
  592.     -----------------------------------------------------
  593.  
  594.     int ethif_init(struct device *dev)
  595.     {
  596.         ...
  597.         dev->send_packet = &ei_send_packet;
  598.         dev->open = &ei_open;
  599.         dev->stop = &ei_close;
  600.         dev->hard_start_xmit = &ei_start_xmit;
  601.         ...
  602.     }
  603.  
  604.     int ethif_init(struct device *dev)
  605.  
  606.     This function is put into the device structure in Space.c.  It is
  607.     called only at boot time, and returns '0' iff the ethercard 'dev'
  608.     exists.
  609.  
  610.     -----------------------------------------------------
  611.  
  612.     static int ei_open(struct device *dev)
  613.     static int ei_close(struct device *dev)
  614.  
  615.     This routine opens and initializes the board in response to an
  616.     socket ioctl() usually called by 'config' or 'ifconfig'.  It is
  617.     commonly stuffed into the 'struct device' by ethif_init().
  618.  
  619.     The inverse routine is ei_close(), which should shut down the
  620.     ethercard, free the IRQs and DMA channels if the hardware permits,
  621.     and turn off anything that will save power (like the transceiver).
  622.  
  623.     (Note: As of NET-2, the relevant program is '/etc/ifconfig' - and
  624.     the device *can* be turned off or on via passing 'up' or 'down'
  625.     to 'ifconfig' from the command line with the device name.)
  626.  
  627.     -----------------------------------------------------
  628.  
  629.     static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
  630.         dev->hard_start_xmit = &ei_start_xmit;
  631.  
  632.     This routine puts packets to be transmitted into the hardware.  It
  633.     is usually stuffed into the 'struct device' by ethif_init().
  634.  
  635.     When the hardware can't accept additional packets it should set
  636.     the dev->tbusy flag.  When additional room is available, usually
  637.     during a transmit-complete interrupt, dev->tbusy should be cleared
  638.     and the higher levels informed with mark_bh(INET_BH).
  639.     [[Note: pre0.99.4 kernels didn't use this interface for all packets.]]
  640.     
  641.     -----------------------------------------------------
  642.  
  643.     ...
  644.         if (dev_rint(buffer, length, is_skb ? IN_SKBUFF : 0, dev))
  645.            stats->rx_dropped++;
  646.     ...
  647.     A received packet is passed to the higher levels using dev_rint().
  648.     If the unadorned packet data in a memory buffer, dev_rint will copy
  649.     it into a 'skbuff' for you.  Otherwise a new skbuff should be
  650.     kmalloc()ed, filled, and passed to dev_rint() with the IN_SKBUFF flag.
  651.  
  652.     -----------------------------------------------------
  653.  
  654. 5.4 Interrupts and Linux
  655.     There are two kinds of interrupt handlers in Linux:
  656.     fast ones and slow ones. You decide what kind you are installing by
  657.     the flags you pass to irqaction().  The fast ones, such as the serial
  658.     interrupt handler, run with _all_ interrupts disabled.  The normal
  659.     interrupt handlers, such as the one for ethercard drivers, runs with
  660.     other interrupts enabled.
  661.  
  662.     There is a two-level interrupt structure.  The "fast" part handles the
  663.     device register, removes the packets, and perhaps sets a flag.   After
  664.     it is done, and interrupts are re-enabled, the slow part is run if the
  665.     flag is set.
  666.  
  667.     The flag between the two parts is set by:
  668.         mark_bh(INET_BH);
  669.  
  670.     Usually this flag is set within dev_rint() during a received-packet
  671.     interrupt, and set directly by the device driver during a
  672.     transmit-complete interrupt.
  673.  
  674.     You might wonder why all interrupt handlers cannot run in
  675.     "normal mode" with other interrupts enabled.  Ross Biro uses this
  676.     scenario to illustrate the problem:
  677.         o You get a serial interrupt, and start processing it.
  678.               The serial interrupt is now masked.
  679.         o You get a network interrupt, and you start transferring
  680.               a maximum-sized 1500 byte packet from the card.
  681.         o Another character comes in, but this time the interrupts
  682.           are masked!
  683.  
  684.     The "fast" interrupt structure solves this problem by allowing
  685.     bounded-time interrupt handlers to run without the risk of leaving
  686.     their interrupt lines masked by another interrupt request.
  687.  
  688.     There is an additional distinction between fast and slow interrupt
  689.     handlers -- the arguments passed to the handler.  A "slow" handler is
  690.     defined as
  691.  
  692.         static void
  693.         handle_interrupt(int reg_ptr)
  694.         {
  695.             int irq = -(((struct pt_regs *)reg_ptr)->orig_eax+2);
  696.             struct device *dev = irq2dev_map[irq];
  697.         ...
  698.  
  699.     While a fast handler gets the interrupt number directly
  700.  
  701.         static void
  702.         handle_fast_interrupt(int irq)
  703.         {
  704.         ...
  705.  
  706.     --------------------------------------------------------------
  707.  
  708. 5.4 Unresolved Questions / Concerns
  709.  
  710.     There may be some benefit from processing packet data as it is
  711.     transferred to and from the ethercard, especially with very fast
  712.     processors transferring data to a slow ethercard.  As I see it this
  713.     question has multiple parts:
  714.         1) Is there any useful processing power available, perhaps
  715.            during the ISA bus recovery period, or while the 8390
  716.            remote DMA is preparing for another transfer??
  717.         2) Is there any useful but simple work that can be done
  718.            between/during each word of the copy, such as calculating
  719.            a CRC, or discarding obviously unwanted packets??
  720.         3) would the complexity of an interface to do this make future
  721.            ethercard drivers impossible??
  722.  
  723.     There should be a better structure than Space.c  Drivers should be
  724.     able to autoprobe for all installed ethercards rather than just
  725.     quitting after finding the first.  I've written code to do this,
  726.     but the constant promise (threat?) of DDI has prevented me from
  727.     making it standard.
  728.  
  729.     A related topic is the problem of driver probes corrupting
  730.     unrelated hardware. Even worse is a probe into a dataport that
  731.     isn't set up to transfer data, which will freeze the machine.  The
  732.     common suggestion is a boot-time device registry that records
  733.     already-used I/O ports and shared memory.
  734.  
  735. 6 Possible Problems, Questions and Troubleshooting.
  736.  
  737.     This section tries to answer any unresolved questions, and not so
  738.     common solutions to common problems.
  739.  
  740. 6.01 Problem with NE2000 Clones -- "DMA address mismatch"
  741.  
  742.     Is the chip a real NatSemi 8390? (DP8390, DP83901, DP83902 or DP83905)?
  743.     If not, some clone chips don't correctly implement the transfer
  744.     verification register.  MS-DOS drivers never do error checking, 
  745.     so it doesn't matter to them.
  746.  
  747.     Are most of the messages off by a factor of 2?
  748.     If so:    Are you using the NE2000 in a 16 bit slot?
  749.         Is it jumpered to use only 8 bit transfers?
  750.     The Linux driver expects a NE2000 to be a 16 bit slot.  A NE1000 can
  751.     be in either size slot.  This problem can also occur with some clones,
  752.     notably D-Link 16 bit cards, that don't have the correct ID bytes
  753.     in the station address PROM. [[ This should be fixed in pl12.]]
  754.  
  755.     Are you running the bus faster than 8Mhz?
  756.     If you can change the speed (faster or slower), see if that
  757.     makes a difference.  Most NE2000 clones will run at 16Mhz, but
  758.     some may not.  Changing speed can also mask a noisy bus.
  759.  
  760.     What other devices are on the bus?
  761.     If moving the devices around changes the reliability, then you
  762.     have a bus noise problem -- just what that error message was
  763.     designed to detect.  Congratulations, you've probably found the
  764.     source of other problems as well.
  765.  
  766. 6.02 Problem with NE2000 Clones -- Machine Hangs during Boot.
  767.  
  768.     Problem:  The machine hangs during boot right after the "8390..."  or
  769.           "WD...." message.  Removing the NE2000 fixes the problem.
  770.  
  771.     Solution: Change your NE2000 base address to 0x360 (or 0x340 for
  772.           pl12 or later kernels.)
  773.  
  774.     Reason:   Your NE2000 clone isn't a good enough clone.  An active 
  775.           NE2000 is a bottomless pit that will trap any driver
  776.           autoprobing in its space.  The other ethercard drivers take
  777.           great pain to reset the NE2000 so that it's safe, but some
  778.           clones cannot be reset.  Clone chips to watch out for: 
  779.           Winbond 83C901.  Changing the NE2000 to a less-popular
  780.           address will move it out of the way of other autoprobes, 
  781.           allowing your machine to boot.  
  782.  
  783.     Problem:  The machine hangs during the SCSI probe at boot.
  784.  
  785.     Solution: It's the same problem as above, change the 
  786.           ethercard's address.
  787.  
  788.     Problem:  The machine hangs during the soundcard probe at boot.
  789.  
  790.     Solution: No, that's really during the silent SCSI probe, and it's
  791.               the same problem as above.
  792.  
  793.  
  794. 6.03 Detected Non-existent Ethercard
  795.  
  796.     Problem:  A WD80*3 is falsely detected.  Removing the sound or 
  797.           MIDI card eliminates the "detected" message.
  798.  
  799.     Solution: Update your ethercard driver: new versions include an
  800.           additional sanity check.
  801.  
  802.     Reason:   Some MIDI ports happen to produce the same checksum as a 
  803.           WD ethercard.
  804.  
  805. 6.04 Error messages from the 80*3
  806.  
  807.     Problem:  You get messages such as the following with your 80*3:
  808.             eth0: bogus packet size, status = ........
  809.             kmalloc called with impossibly large argument (65400)
  810.             eth0: Couldn't allocate sk_buff of size 65400
  811.             eth0: receiver overrun
  812.  
  813.     Reason:   There is a shared memory problem.
  814.  
  815.     Solution: If the problem is sparodic, you have hardware problems.
  816.           Typical problems that are easy to fix are board conflicts, 
  817.           having cache or "shadow ROM" enabled for that region, or 
  818.           running your bus faster than 8Mhz.  There are also a 
  819.           surprising number of memory failures on ethernet cards, 
  820.           so run a diagnostic program if you have one for your 
  821.           ethercard.
  822.  
  823.           If the problem is continual, and you have have to reboot
  824.           to fix the problem, record the boot-time probe message 
  825.           and mail it to becker@super.org  Take particular note of
  826.           the shared memory location.
  827.  
  828. 6.05 Choosing the Interrupt of the 3c503 
  829.  
  830.     Problem:  The 3c503 picks IRQ n at boot, but this is needed for some
  831.           other device which needs IRQ n. (eg. CD ROM driver, etc.)
  832.           Can this be fixed without compiling this into the kernel?
  833.  
  834.     Solution: The 3c503 driver probes for a free IRQ line in the order
  835.           {5, 9, 3, 4}, and it should pick a line which isn't being 
  836.           used.  The pre-pl12 (SLS 1.02) driver picked the IRQ line 
  837.           at boot-time, and the current driver (pl12) chooses when
  838.           the card is open()/'ifconfig'ed.
  839.  
  840.           Alternately, you can fix the IRQ at boot by passing 
  841.           parameters via LILO.  The following selects IRQ9, base 
  842.           location 0x300, <ignored value>, and if_port #1 (the 
  843.           external transceiver).  
  844.             lilo: linux ether=9,0x300,0,1,eth0
  845.  
  846.           The following selects IRQ3, probes for the base location,
  847.           <ignored value>, and the default if_port #0 (the internal 
  848.           transceiver) 
  849.             lilo: linux ether=3,0,0,0,eth0
  850.  
  851. 6.06 Choosing the Output of the 3c503 (thicknet vs. thinnet)
  852.  
  853.     Problem:  The supplied 3c503 drivers don't use the AUI (thicknet) port.
  854.           How does one choose it over the default thinnet port?
  855.  
  856.     Solution: The 3c503 AUI port can be selected at boot-time with 0.99pl12
  857.           and later.  The selection is overloaded onto the low bit of 
  858.           the currently-unused dev->rmem_start variable, so a boot-time
  859.           parameter of:
  860.             lilo: linux ether=0,0,0,1,eth0
  861.           should work.  A boot line to force IRQ 5, port base 0x300, 
  862.           and use an external transceiver is:
  863.             lilo: linux ether=5,0x300,0,1,eth0
  864.  
  865. 6.07 Using More than one Ethernet Card. (eg. a gateway machine.)
  866.  
  867.     Problem:  What needs to be done so that Linux can run two 
  868.           ethernet cards?
  869.  
  870.     Solution: Add another entry to Space.c, naming it "eth1" instead 
  871.           of "eth0".  If you want routing to work well you should
  872.           use a recent kernel, say 0.99pl11 or later.  You may also
  873.           want to verify that your driver writer kept all of the
  874.           per-card variables in 'dev->priv'.  Most do, but the pl12
  875.           AT1500/LANCE driver has a single static low-memory buffer.
  876.  
  877. 7 Networking with a Laptop Computer
  878.     There are currently only a few ways to put your laptop on a network.
  879.     You can use the NET-2 SLIP code (and run at serial line speeds);
  880.     you can buy one of the few laptops that come with a NE2000-compatible
  881.     ethercard or PCMCIA slot built-in; you can get a laptop with a 
  882.     docking station and plug in an ISA ethercard; or you can use a 
  883.     parallel port Ethernet adapter such as the D-Link DE-600.
  884.  
  885. 7.1 Option 1 -- using SLIP
  886.  
  887.     This is the cheapest solution, but by far the most difficult. Also,
  888.     you will not get very high transmission rates. Since SLIP is not
  889.     really related to ethernet cards, it will not be discussed further
  890.     here. See the NET-2 HOWTO.
  891.  
  892. 7.2 Option 2 -- NE2000 Compatible Card built in or PCMCIA slot and ethercard.
  893.  
  894.     The second solution severely limits your laptop choices and is fairly
  895.     expensive.  Be sure to read the specifications carefully, you may find
  896.     that you will have to buy an additional non-standard transceiver to
  897.     actually put the machine on a network.
  898.  
  899. 7.3 Option 3 -- ISA Ethercard in the Docking Station.
  900.  
  901.     I recommend the third solution.  Docking stations for laptops typically
  902.     cost about $250 and provide two full-size ISA slots, two serial and one
  903.     parallel port.  Most (all?) docking stations are powered off of the
  904.     laptop's batteries, and a few allow adding extra batteries in the
  905.     docking station if you use short ISA cards.  You can add an inexpensive
  906.     ethercard and enjoy full-speed ethernet performance.
  907.  
  908. 7.4 Option 4 -- Pocket / Parallel port Adaptors.
  909.  
  910.     The "pocket" ethernet adaptors may also fit your need.
  911.     Until recently they actually costed more than a docking station and
  912.     cheap ethercard, and most tie you down with a wall-brick power supply.
  913.     The only pocket adaptor driver right now is for the D-Link.
  914.     I'm also working on a driver for the AT-LAN-TEC/RealTek pocket adaptor.
  915.     Most other companies, especially Xircom, treat the programming
  916.     information as a trade secret, so support will likely be slow in
  917.     coming.
  918.  
  919.     You can sometimes avoid the wall-brick with the adaptors by buying
  920.     or making a cable that draws power from the laptop's keyboard
  921.     port.
  922.     
  923.  
  924. 8 Miscellaneous.
  925.  
  926.     Any other associated stuff that didn't fit in anywhere else gets
  927.     dumped here. It may not be relevant, and it may not be of general
  928.     interest but it is here anyway.
  929.  
  930. 8.1 The Cabletron Story. (...as related by Donald J. Becker)
  931.  
  932.     This is a rather funny story, albeit true. -- Enjoy! P.G.
  933.  
  934.         I contacted Cabletron in early December 1992 for 
  935.     programming information 11, 1992 (I had called and sent 
  936.     several earlier messages).  I was referred through several 
  937.     different people, and each one took several days to 
  938.     respond before they forwarded me to the next.  Eventually 
  939.     I was told I should deal with their (outside?) developer 
  940.     Mr. Dev.Null.  I persisted, and around March it seemed 
  941.     that I had finally succeed: Cabletron offered to send me 
  942.     an evaluation board (unrequested) and everything I needed 
  943.     to use it (what I wanted).  The hardware showed up right 
  944.     away, and I waited, expecting the the programming 
  945.     information information as well.  About a month later I 
  946.     contacted them, and they told me that "all I needed to use 
  947.     it" was the standard MS-DOS NDIS drivers, a binary on 
  948.     standard driver disk.  The disk envelope was covered in 
  949.     legalese, including no-disassembly, no-reverse-engineering 
  950.     clauses.  It was May (and a few email exchanges later) 
  951.     before I figured out that I had been "slow rolled", and 
  952.     had wasted about 20 hours on this particular windmill.  
  953.  
  954.     The story isn't over yet.  People have written to me say 
  955.     they have vetoed several medium-sized purchases from 
  956.     Cabletron based on the lack of Linux drivers.  Cabletron 
  957.     must have noticed this because yesterday I got a call 
  958.     _from_ Cabletron (the first!) stating that they will be 
  959.     independently writing a Linux driver.  Of course, their 
  960.     lawyers probably haven't read the GPL yet...  
  961.     
  962.  
  963.  
  964.         ----------- end of Ethernet HOWTO ------------
  965.  
  966.  
  967. -- 
  968. Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
  969.  
  970.